  
So new, it's not even a beta test. But it works!   

http://astron.berkeley.edu/~mperrin/software/FITSSpotlightPlugin.zip 

FITS Spotlight Plugin

	Code released under the BSD Open Source License
	See LICENSE.txt for more information.
	
	By Marshall Perrin <mperrin@astro.berkeley.edu>

	This version links against CFITSIO, so it's a bit more
	of a resource hog than it might someday be. Still, it
	can import 30-50 files per second on my G4 powerbook. 



To use:  
   
Unzip the archive, go into the Build subdirectory, and find 
"FITS Spotlight Plugin.mdimporter". Copy it into /Library/Spotlight/ 
(you may need to be root to do this).  
   
FITS files will now be indexed as you modify them, or you can manually
import them from the command line with "mdimport <filenames>" to tell
Spotlight to reindex them.  (see 'man mdimport' for a bunch of other
options).   
   
You'll need cfitsio.dylib installed somewhere on your system for this to   
work. Mine's in /usr/local/lib. Make sure you've got the dylib version  
('make shared') not just the static version ('make'). 
   
Things to try include Get Info on FITS files and keyword searches in 
the Finder (the FITS keywords are accessible from the "Other..."  
selection on the drop down menu) 
   
To hack on the code: 
   
Install the Developer Tools if you haven't already. Then just  
double-click on the Xcode file. Whenever you build a new version, you   
have to delete the old plugin from /Library/Spotlight and then copy the 
new build in.  
   
See   
http://developer.apple.com/documentation/Carbon/Conceptual/MDImporters/index.html   
for all the gory details.  
   
   
Right now it only gets a small subset of keywords, and they're all   
strings. More will come... Right now it can index about 60 files per 
second on my 1.25 GHz Powerbook, which is really not too bad.  
I don't -think- it leaks memory or anything like that, but hey, I only  
got it running half an hour ago, so who knows.  

The keyword list index is based on the file "FITS_keywords.txt". The 
perl script "make_schemas.pl" autogenerates the XML Plist and Schema files
based on the contents of that text file. It does -not- yet autogenerate the
Objective-C code in GetMetadataForFile.m; you've got to make that by hand.

   
One major drawback that I don't think we can easily get around is that  
it won't index gziped fits files. (since those have a ".gz" extension   
and thus are a different file type from the OS's perspective.) 
   
   
This was actually pretty straightforward in the end; it would've taken  
half as long if I actually knew Objective-C well rather than just 
messing about by trial and error. The conversions between regular C  
strings and CFString took me way longer to get right than I care to  
admit... But kudos to Apple for a nice programming interface.  
   
